#set(String masterMenu = "1")
#set(String sysActiveMenu = "1")
#tag layout_block("sidebar")
	#include("/fragment/menu.html")
#end
#tag layout_block("main")
	<div id="menu-manager" v-cloak>
		<div class="col-xs-offset-2 col-xs-6">
			<div class="form-group">
				<input type="text" class="form-control" placeholder="请输入编码或名称" v-model="searchName">
			</div>
		</div>
		<div class="col-xs-4">
			<button type="button" class="btn btn-primary" @click="reloadContent(0)">查询</button>
			<button type="button" class="btn btn-info" @click="addRecord()">新建</button>
		</div>
		<div class="col-xs-12">
			<table class="table table-hover custom-table">
				<thead>
					<tr>
						<th>序号</th>
						<th>编码</th>
						<th>名称</th>
						<th>价格（元）</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<tr v-for="item in content">
						<td>{{page*size+$index+1}}</td>
						<td>{{item.CODE}}</td>
						<td>{{item.NAME}}</td>
						<td>{{item.PRICE | fixed 2}}</td>
						<td>
							<button type="button" class="btn btn-xs btn-primary" @click="editRecord(item)">编辑</button>
							<button type="button" class="btn btn-xs btn-danger" @click="delRecord(item.ID)">删除</button>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="col-xs-12 archive-pages text-center" id="laypage-ctl"></div>
		<!-- Modal -->
		<div class="modal fade" id="menu-modal" tabindex="-1" role="dialog"
			aria-labelledby="menuModalLabel" aria-hidden="true" data-backdrop="static">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">
							<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
						</button>
						<h4 class="modal-title" id="menuModalLabel">增加菜单</h4>
					</div>
					<div class="modal-body">
						<form class="form-horizontal" role="form" style="margin-top: 10px;">
							<div class="form-group">
								<label for="code" class="col-sm-2 control-label">编码</label>
								<div class="col-sm-9">
									<input name="code" type="text" class="form-control" placeholder="菜单数字编码，用于快速定位数据" v-model="info.code">
								</div>
							</div>
							<div class="form-group">
								<label for="name" class="col-sm-2 control-label">名称</label>
								<div class="col-sm-9">
									<input name="name" type="text" class="form-control" placeholder="菜单中文名称" v-model="info.name">
								</div>
							</div>
							<div class="form-group">
								<label for="price" class="col-sm-2 control-label">价格</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input name="price" type="text" class="form-control" placeholder="不能超出两位小数点，max：9999.99"
										v-model="info.price" v-bind:disabled="!isAdd">
										<div class="input-group-addon">元</div>
									</div>
								</div>
							</div>
						</form>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-primary" @click="saveRecord()">保存</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="assets/js/laypage.js"></script>
	<script type="text/javascript" src="assets/js/biz/menu/manager.js"></script>
#end
#include ("/layout/default.html")